package vip.jc.integration.dynamicwithshardingSphere.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import vip.jc.integration.dynamicwithshardingSphere.dao.entity.MultiSource;
import vip.jc.integration.dynamicwithshardingSphere.service.MultiSourceService;

@RestController
public class MultiSourceController {

    @Autowired
    private MultiSourceService multiSourceService;

    @GetMapping("/multiSource/{id}")
    public MultiSource getMultiSource(@PathVariable("id") Long id ) {
        return multiSourceService.getById(id);
    }

    @PostMapping("/multiSource/add")
    public void addMultiSource(@RequestBody MultiSource multiSource) {
        multiSourceService.addMultiSource(multiSource);
    }
}
